<!DOCTYPE html>
<html  ng-app="indexRoute">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>Intelab--首页</title>
    <link rel="icon" type="image/x-icon" href="image/111111.ico">
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min1.css">
    <link rel="stylesheet" type="text/css" href="css/base.css">
    <link rel="stylesheet" type="text/css" href="css/common.css">
    <link rel="stylesheet" type="text/css" href="css/page.css">
    <link rel="stylesheet" type="text/css" href="layer/skin/default/layer.css">
    <script type="text/javascript" src="js/jBASE64.js"></script>
    <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="js/cookie.js"></script>
    <script type="text/javascript" src="js/ajaxfileupload.js"></script>
</head>
<body style="background-color:#f9f9f9; " >
<div class="mainContent" ng-controller="mainController">

    <div class="header" data-ng-init="updateLogoInit()">
        <div class="header-logo">
            <span class="index-qylogo-bg" ng-init="InitImg = 'image/qylogo.png'">
                <img  ng-src="{{currentUser.companyLogo}}"  data-toggle="modal"  data-target="#uploadLogo" data-backdrop="static" ng-style="{cursor:hasUpdataLogo==1?'pointer':'default',title:hasUpdataLogo==1?'修改企业logo':''}" ng-click="updateLogoInit();" class="index-qylogo"></span>
        </div>
        <div class="main-header-layout">
            <h1 class="logo fl f32" id="main-logo-text">INTELAB云管理系统</h1>
            <!--<div id="zoch" style="color: white; font-size: 20px; cursor: pointer;">测试专用</div>-->
            <ul class="header-nav fr pt5" id="head-user">
                <li id="hovershow" style="position: relative; height: 40px;" >
                    <a href="javascript:void(0)" ><img src="image/Mask.png" style="width: 28px; height: 28px;padding:0 8px 8px 0 "></a>
                    <a id="logoff" href="javascript:void(0)"  data-toggle="modal" data-target="#log_off">退出登录</a>
                </li>
                <li>
                    <a href="#personalData" class="nav-login" title="个人信息">{{currentUser.name}}</a>
                    <i style="width: 18px; padding: 0 20px 5px 20px; color: #5D6270">|</i>
                    <a href="javascript:void(0)" style="cursor: default">
                        <img ng-src="{{currentUser.bindMobile==1?'image/Shape2.png':'image/Shape.png'}}" title="手机号验证" style="width: 18px; height: 20px; padding-bottom: 5px">
                    </a>
                </li>
            </ul>
        </div>

    </div>
    <div class="conLeft">
        <!--导航条-->
        <div style="width: 100%; height: 430px; margin-top: 20px">
            <ul class="left_menu" id="left_menu" ng-repeat="menu in menuList" >
                <li ng-click="setmenuStyle(menu)">
                    <img class="menu-img-style" ng-src="{{menu.background}}"/>
                    <a class="menu-title" ng-href="{{menu.url}}" ng-style="menu.style" id="{{menu.menuId}}">{{menu.name}}</a>
                </li>
            </ul>
        </div>
        <div id="history_go"  class="history_go">
            <img src="image/history.png" >返回上一级
        </div>
    </div>

    <div class="conRight" ng-view></div>

    <div class="clearfloat"></div>

    <!-- Modal---添加企业logo-->
    <div id="uploadLogo" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="uploadLogoLable"
         aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4 id="uploadLogoLable">上传企业Logo</h4>
        </div>
        <div class="modal-body">
            <div class="container" style="width:480px; height: 212px !important; padding-bottom:20px">
                <div class="add_logo_file">
                    <span>请选择图片：</span><input  id="logofileToUpload" name="logofileToUpload" type="file"/>
                    <div class="col-md-12">
                        <img id="addlogoPhotoNew" ng-src=""  style="max-width:200px;max-height:200px;margin:0 auto;display:block;"/>
                    </div>
                    <p style="font-size: 11px; padding-left: 38px"> * 推荐图片上传尺寸：118px * 32px，分辨率大小：96dpi</p>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
            <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"  ng-click="SaveUpdateLogoInfo()">保 存</button>
        </div>
    </div>

    <!--退出登录确定框-->

    <div id="log_off" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="updateUserPwdLabel"
         aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4 id="updateUserPwdLabel">退出登录</h4>
        </div>
        <div class="modal-body" style="width: 500px; min-height: 100px !important; ">
            <p style=" height:40px; text-align: center; font: 20px/40px '微软雅黑'; -webkit-margin-before:30px!important;">确定退出登录？</p>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
            <button class="btn btn-primary"  data-dismiss="modal" aria-hidden="true" id="logout">确 定</button>
        </div>
    </div>
</div>
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/angular.js"></script>
<script type="text/javascript" src="js/underscore-1.8.3.min.js"></script>
<script type="text/javascript" src="js/angular-route.min.js"></script>
<script type="text/javascript" src="controller/IndexRoute.js"></script>
<script type="text/javascript" src="controller/ControUser.js"></script>
<script type="text/javascript" src="js/anjular-cookies.min.js"></script>
</body>
<script type="text/javascript" src="js/ichart.1.2.min.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=rzi1SdGriyCMknUEWdTSO9GMqKsFgXQZ"></script>
<script type="text/javascript" src="js/angular-animate.min.js"></script>
<script type="text/javascript" src="js/echarts.min.js"></script>
<script type="text/javascript" src="controller/echartCanves.js"></script>
<script type="text/javascript" src="controller/ichartPillar2.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript" src="layer/layer.js"  charset="utf-8"></script>
<script type="text/javascript">
   $(function () {
        var contentHeight =  $(".mainContent").height(); //内容高度
        //  var documentHeight = document.body.scrollHeight;//js 获取文档高度
        //   var documentHeight =  $(document).height(); //jquery 获取文档高度
        var windowHeight =  $(window).height(); //jquery 获取浏览器窗口高度
      // alert(windowHeight+","+contentHeight)
       if(windowHeight>contentHeight){
           $(".mainContent").css("margin-top",(windowHeight-contentHeight)/2.2);
       }else {
           $(".mainContent").css("margin-top","10px");
       }


        var list = $('#lou-Distribute, #plate-set, #user-List, #user-Unit,#company-List, #chart-Report, #user-Details, #platform-user');
        list.click(function () {
            list.removeClass('selectColor');
            jQuery(this).addClass('selectColor');
        });

       $("#hovershow").mouseover(function () {
           $("#logoff").show();
       });
       $("#hovershow").mouseout(function () {
           $("#logoff").hide();
       });




       $("#logout").click(function () {

           $.ajax({
               type: "post",
               url: serviceHttp  + 'api/rest/firm/person/mine/info',
               dataType: "json",
               success: function (data) {
                   var json = eval(data.data);
//                   清楚cookie中的用户名和密码
                   setCookie("saveCookie","",24,"/");
                   setCookie("userName","",24,"/");
                   setCookie("userPwd", "",24,"/");
                   $("#saveCookie").removeAttr('checked');

                   if(json.role.authority == "SERVICE_MANAGER" || json.role.authority == "SERVICE_BUSINESS"){
                       // 清除sessionid
                       $.ajax({
                           type:"post",
                           url:serviceHttp  + 'api/rest/logout',
                           dataType:"json",
                           success:function () {
                               window.location.href = serviceHttp + "inspect/Lab_login.html";
                           },
                           error:function (XMLHttpRequest, textStatus, errorThrown) {
                               console.log("清除sessionid不成功")
                           }
                       })
                   }else{
                       // 清除sessionid
                       $.ajax({
                           type:"post",
                           url:serviceHttp  + 'api/rest/logout',
                           dataType:"json",
                           success:function () {
                               window.location.href = serviceHttp + "inspect/Lab_login.html" + "?company=" + json.companyId;
                           },
                           error:function (XMLHttpRequest, textStatus, errorThrown) {
                               console.log("清除sessionid不成功")
                           }
                       })
                   }
               },
               error: function (XMLHttpRequest, textStatus, errorThrown) {
                   alert("退出失败");
               }
           });
       })
    })
</script>

</html>